
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NewJFrame.java
 *
 * Created on 5.3.2010, 14:41:53
 */
/**
 *
 * @author Kuba
 */
public class MainJframe extends javax.swing.JFrame {

    /** Creates new form NewJFrame */
    public MainJframe() {
        initComponents();

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        bookRectangle = new javax.swing.JPanel();
        rectangleContr1 = new RectangleContr();
        bookCircular = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jSliderLambda = new javax.swing.JSlider();
        jSpinnerLambda = new javax.swing.JSpinner();
        jLabelLambda = new javax.swing.JLabel();
        jSliderDiameter = new javax.swing.JSlider();
        jLabelADiameter = new javax.swing.JLabel();
        jSpinnerDiameter = new javax.swing.JSpinner();
        jSliderDistance = new javax.swing.JSlider();
        jLabelDistance = new javax.swing.JLabel();
        jSpinnerDistance = new javax.swing.JSpinner();
        jSliderZoom = new javax.swing.JSlider();
        jLabelZoom = new javax.swing.JLabel();
        jSpinnerZoom = new javax.swing.JSpinner();
        jSliderExposition = new javax.swing.JSlider();
        jLabelExposition = new javax.swing.JLabel();
        jSpinnerExposition = new javax.swing.JSpinner();
        jLabelLambdaJ = new javax.swing.JLabel();
        jLabelDiameterJ = new javax.swing.JLabel();
        jLabelDistanceJ = new javax.swing.JLabel();
        jLabelZoomJ = new javax.swing.JLabel();
        jLabelExpositionJ = new javax.swing.JLabel();
        pictCircle = new Picture();
        bookDiagram = new javax.swing.JPanel();
        sceneJp1 = new sceneJp();
        bookFormulas = new javax.swing.JPanel();
        equationsJp1 = new equationsJp();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("DifraQtator");
        setResizable(false);

        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        javax.swing.GroupLayout bookRectangleLayout = new javax.swing.GroupLayout(bookRectangle);
        bookRectangle.setLayout(bookRectangleLayout);
        bookRectangleLayout.setHorizontalGroup(
            bookRectangleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(rectangleContr1, javax.swing.GroupLayout.DEFAULT_SIZE, 945, Short.MAX_VALUE)
        );
        bookRectangleLayout.setVerticalGroup(
            bookRectangleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bookRectangleLayout.createSequentialGroup()
                .addComponent(rectangleContr1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Rectangle", bookRectangle);

        jButton1.setText("Show");
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jSliderLambda.setMaximum(700);
        jSliderLambda.setMinimum(380);
        jSliderLambda.setValue((int)pictCircle.getLambda());
        jSliderLambda.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderLambdaStateChanged(evt);
            }
        });

        jSpinnerLambda.setValue(pictCircle.getLambda());
        jSpinnerLambda.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSpinnerLambdaStateChanged(evt);
            }
        });

        jLabelLambda.setText("Wavelength");

        jSliderDiameter.setMaximum(500000);
        jSliderDiameter.setValue((int)pictCircle.getApertureDiameter());
        jSliderDiameter.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderDiameterStateChanged(evt);
            }
        });

        jLabelADiameter.setText("Aperture diameter");

        jSpinnerDiameter.setValue(pictCircle.getApertureDiameter());
        jSpinnerDiameter.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSpinnerDiameterStateChanged(evt);
            }
        });

        jSliderDistance.setMaximum(2000);
        jSliderDistance.setValue((int)pictCircle.getZ());
        jSliderDistance.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderDistanceStateChanged(evt);
            }
        });

        jLabelDistance.setText("Distance");

        jSpinnerDistance.setValue(pictCircle.getZ());
        jSpinnerDistance.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSpinnerDistanceStateChanged(evt);
            }
        });

        jSliderZoom.setMaximum(50000);
        jSliderZoom.setValue((int)pictCircle.getZoom());
        jSliderZoom.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderZoomStateChanged(evt);
            }
        });

        jLabelZoom.setText("Zoom");

        jSpinnerZoom.setValue(pictCircle.getZoom());
        jSpinnerZoom.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSpinnerZoomStateChanged(evt);
            }
        });

        jSliderExposition.setMinimum(1);
        jSliderExposition.setValue((int)pictCircle.getExposition());
        jSliderExposition.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderExpositionStateChanged(evt);
            }
        });

        jLabelExposition.setText("Intensity");

        jSpinnerExposition.setValue(pictCircle.getExposition());
        jSpinnerExposition.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSpinnerExpositionStateChanged(evt);
            }
        });

        jLabelLambdaJ.setText("nm");

        jLabelDiameterJ.setText("nm");

        jLabelDistanceJ.setText("mm");

        jLabelZoomJ.setText("x");

        jLabelExpositionJ.setText("x");

        pictCircle.setPreferredSize(new java.awt.Dimension(500, 500));

        javax.swing.GroupLayout pictCircleLayout = new javax.swing.GroupLayout(pictCircle);
        pictCircle.setLayout(pictCircleLayout);
        pictCircleLayout.setHorizontalGroup(
            pictCircleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 500, Short.MAX_VALUE)
        );
        pictCircleLayout.setVerticalGroup(
            pictCircleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 500, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout bookCircularLayout = new javax.swing.GroupLayout(bookCircular);
        bookCircular.setLayout(bookCircularLayout);
        bookCircularLayout.setHorizontalGroup(
            bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bookCircularLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pictCircle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bookCircularLayout.createSequentialGroup()
                        .addGap(144, 144, 144)
                        .addComponent(jButton1)
                        .addGap(120, 120, 120))
                    .addGroup(bookCircularLayout.createSequentialGroup()
                        .addGap(79, 79, 79)
                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelLambda)
                            .addComponent(jLabelExposition)
                            .addGroup(bookCircularLayout.createSequentialGroup()
                                .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, bookCircularLayout.createSequentialGroup()
                                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jSliderLambda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jSliderExposition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jSpinnerLambda, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)
                                            .addComponent(jSpinnerExposition, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, bookCircularLayout.createSequentialGroup()
                                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabelADiameter)
                                            .addComponent(jSliderDiameter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabelDistance)
                                            .addComponent(jSliderDistance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabelZoom)
                                            .addComponent(jSliderZoom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(jSpinnerDiameter)
                                            .addComponent(jSpinnerDistance)
                                            .addComponent(jSpinnerZoom, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabelExpositionJ)
                                    .addComponent(jLabelLambdaJ)
                                    .addComponent(jLabelDiameterJ)
                                    .addComponent(jLabelDistanceJ)
                                    .addComponent(jLabelZoomJ))
                                .addGap(92, 92, 92)))
                        .addContainerGap())))
        );
        bookCircularLayout.setVerticalGroup(
            bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bookCircularLayout.createSequentialGroup()
                .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bookCircularLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(pictCircle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(bookCircularLayout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(bookCircularLayout.createSequentialGroup()
                                .addComponent(jLabelLambda)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSliderLambda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabelExposition, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSliderExposition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(bookCircularLayout.createSequentialGroup()
                                .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jSpinnerLambda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabelLambdaJ))
                                .addGap(34, 34, 34)
                                .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jSpinnerExposition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabelExpositionJ))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelADiameter)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(bookCircularLayout.createSequentialGroup()
                                .addComponent(jSliderDiameter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabelDistance))
                            .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jSpinnerDiameter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelDiameterJ)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(bookCircularLayout.createSequentialGroup()
                                .addComponent(jSliderDistance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabelZoom))
                            .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jSpinnerDistance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelDistanceJ)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSliderZoom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(bookCircularLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jSpinnerZoom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelZoomJ)))
                        .addGap(64, 64, 64)
                        .addComponent(jButton1)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Circular", bookCircular);

        javax.swing.GroupLayout sceneJp1Layout = new javax.swing.GroupLayout(sceneJp1);
        sceneJp1.setLayout(sceneJp1Layout);
        sceneJp1Layout.setHorizontalGroup(
            sceneJp1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 921, Short.MAX_VALUE)
        );
        sceneJp1Layout.setVerticalGroup(
            sceneJp1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 435, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout bookDiagramLayout = new javax.swing.GroupLayout(bookDiagram);
        bookDiagram.setLayout(bookDiagramLayout);
        bookDiagramLayout.setHorizontalGroup(
            bookDiagramLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bookDiagramLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(sceneJp1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        bookDiagramLayout.setVerticalGroup(
            bookDiagramLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bookDiagramLayout.createSequentialGroup()
                .addContainerGap(72, Short.MAX_VALUE)
                .addComponent(sceneJp1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Diagram", bookDiagram);

        javax.swing.GroupLayout equationsJp1Layout = new javax.swing.GroupLayout(equationsJp1);
        equationsJp1.setLayout(equationsJp1Layout);
        equationsJp1Layout.setHorizontalGroup(
            equationsJp1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 409, Short.MAX_VALUE)
        );
        equationsJp1Layout.setVerticalGroup(
            equationsJp1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 338, Short.MAX_VALUE)
        );

        jLabel1.setText("Scene side ration:");

        jLabel2.setText("Rectangular aperture intensity equation:");

        jLabel3.setText("Circular aperture intensity equation:");

        jLabel4.setText("Airy disc equation:");

        javax.swing.GroupLayout bookFormulasLayout = new javax.swing.GroupLayout(bookFormulas);
        bookFormulas.setLayout(bookFormulasLayout);
        bookFormulasLayout.setHorizontalGroup(
            bookFormulasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bookFormulasLayout.createSequentialGroup()
                .addContainerGap(82, Short.MAX_VALUE)
                .addGroup(bookFormulasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4))
                .addGap(68, 68, 68)
                .addComponent(equationsJp1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(156, 156, 156))
        );
        bookFormulasLayout.setVerticalGroup(
            bookFormulasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bookFormulasLayout.createSequentialGroup()
                .addGap(106, 106, 106)
                .addComponent(jLabel1)
                .addGap(79, 79, 79)
                .addComponent(jLabel2)
                .addGap(91, 91, 91)
                .addComponent(jLabel3)
                .addGap(63, 63, 63)
                .addComponent(jLabel4)
                .addContainerGap(117, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bookFormulasLayout.createSequentialGroup()
                .addContainerGap(93, Short.MAX_VALUE)
                .addComponent(equationsJp1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(89, 89, 89))
        );

        jTabbedPane1.addTab("Formulas", bookFormulas);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 950, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 550, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jButton1ActionPerformed

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
        pictCircle.setType("circle");        // TODO add your handling code here:
        pictCircle.repaint();
}//GEN-LAST:event_jButton1MouseClicked

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
        //pictCircle.setType("black");        // TODO add your handling code here:
        //pictCircle.repaint();
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jSliderLambdaStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderLambdaStateChanged
        // TODO add your handling code here:
        jSpinnerLambda.setValue(jSliderLambda.getValue());
        pictCircle.setLambda(jSliderLambda.getValue());
    }//GEN-LAST:event_jSliderLambdaStateChanged

    private void jSpinnerLambdaStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinnerLambdaStateChanged
        // TODO add your handling code here:
        jSliderLambda.setValue((Integer) jSpinnerLambda.getValue());
        pictCircle.setLambda((Integer) jSpinnerLambda.getValue());
    }//GEN-LAST:event_jSpinnerLambdaStateChanged

    private void jSliderDiameterStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderDiameterStateChanged
        // TODO add your handling code here:
        jSpinnerDiameter.setValue(jSliderDiameter.getValue());
        pictCircle.setApertureDiameter(jSliderDiameter.getValue());
    }//GEN-LAST:event_jSliderDiameterStateChanged

    private void jSpinnerDiameterStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinnerDiameterStateChanged
        // TODO add your handling code here:
        jSliderDiameter.setValue((Integer) jSpinnerDiameter.getValue());
        pictCircle.setApertureDiameter((Integer) jSpinnerDiameter.getValue());
    }//GEN-LAST:event_jSpinnerDiameterStateChanged

    private void jSliderDistanceStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderDistanceStateChanged
        // TODO add your handling code here:
        jSpinnerDistance.setValue(jSliderDistance.getValue());
        pictCircle.setZ(jSliderDistance.getValue());
    }//GEN-LAST:event_jSliderDistanceStateChanged

    private void jSpinnerDistanceStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinnerDistanceStateChanged
        // TODO add your handling code here:
        jSliderDistance.setValue((Integer) jSpinnerDistance.getValue());
        pictCircle.setZ((Integer) jSpinnerDistance.getValue());
    }//GEN-LAST:event_jSpinnerDistanceStateChanged

    private void jSliderZoomStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderZoomStateChanged
        // TODO add your handling code here:
        jSpinnerZoom.setValue(jSliderZoom.getValue());
        pictCircle.setZoom(jSliderZoom.getValue());
    }//GEN-LAST:event_jSliderZoomStateChanged

    private void jSpinnerZoomStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinnerZoomStateChanged
        // TODO add your handling code here:
        jSliderZoom.setValue((Integer) jSpinnerZoom.getValue());
        pictCircle.setZoom((Integer) jSpinnerZoom.getValue());
    }//GEN-LAST:event_jSpinnerZoomStateChanged

    private void jSliderExpositionStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderExpositionStateChanged
        // TODO add your handling code here:
        jSpinnerExposition.setValue(jSliderExposition.getValue());
        pictCircle.setExposition(jSliderExposition.getValue());
    }//GEN-LAST:event_jSliderExpositionStateChanged

    private void jSpinnerExpositionStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinnerExpositionStateChanged
        // TODO add your handling code here:
        jSliderExposition.setValue((Integer) jSpinnerExposition.getValue());
        pictCircle.setExposition((Integer) jSpinnerExposition.getValue());
    }//GEN-LAST:event_jSpinnerExpositionStateChanged

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {



            public void run() {
                try {
                    // Install the look and feel
                String nativeLF = UIManager.getSystemLookAndFeelClassName();
                UIManager.setLookAndFeel(nativeLF);
                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(MainJframe.class.getName()).log(Level.SEVERE, null, ex);
                } catch (InstantiationException ex) {
                    Logger.getLogger(MainJframe.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    Logger.getLogger(MainJframe.class.getName()).log(Level.SEVERE, null, ex);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(MainJframe.class.getName()).log(Level.SEVERE, null, ex);
                }

                new MainJframe().setVisible(true);


            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel bookCircular;
    private javax.swing.JPanel bookDiagram;
    private javax.swing.JPanel bookFormulas;
    private javax.swing.JPanel bookRectangle;
    private equationsJp equationsJp1;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabelADiameter;
    private javax.swing.JLabel jLabelDiameterJ;
    private javax.swing.JLabel jLabelDistance;
    private javax.swing.JLabel jLabelDistanceJ;
    private javax.swing.JLabel jLabelExposition;
    private javax.swing.JLabel jLabelExpositionJ;
    private javax.swing.JLabel jLabelLambda;
    private javax.swing.JLabel jLabelLambdaJ;
    private javax.swing.JLabel jLabelZoom;
    private javax.swing.JLabel jLabelZoomJ;
    private javax.swing.JSlider jSliderDiameter;
    private javax.swing.JSlider jSliderDistance;
    private javax.swing.JSlider jSliderExposition;
    private javax.swing.JSlider jSliderLambda;
    private javax.swing.JSlider jSliderZoom;
    private javax.swing.JSpinner jSpinnerDiameter;
    private javax.swing.JSpinner jSpinnerDistance;
    private javax.swing.JSpinner jSpinnerExposition;
    private javax.swing.JSpinner jSpinnerLambda;
    private javax.swing.JSpinner jSpinnerZoom;
    private javax.swing.JTabbedPane jTabbedPane1;
    private Picture pictCircle;
    private RectangleContr rectangleContr1;
    private sceneJp sceneJp1;
    // End of variables declaration//GEN-END:variables
}
